@hep-code-runner/react 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/dist/index.js +73 -73
- package/dist/index.mjs +335 -335
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
35
35
|
* @namespace
|
|
36
36
|
* @public
|
|
37
37
|
*/var n=function(c){var m=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,_=0,w={},l={manual:c.Prism&&c.Prism.manual,disableWorkerMessageHandler:c.Prism&&c.Prism.disableWorkerMessageHandler,util:{encode:function t(r){return r instanceof b?new b(r.type,t(r.content),r.alias):Array.isArray(r)?r.map(t):r.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++_}),t.__id},clone:function t(r,i){i=i||{};var s,o;switch(l.util.type(r)){case"Object":if(o=l.util.objId(r),i[o])return i[o];s={},i[o]=s;for(var p in r)r.hasOwnProperty(p)&&(s[p]=t(r[p],i));return s;case"Array":return o=l.util.objId(r),i[o]?i[o]:(s=[],i[o]=s,r.forEach(function(E,g){s[g]=t(E,i)}),s);default:return r}},getLanguage:function(t){for(;t;){var r=m.exec(t.className);if(r)return r[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,r){t.className=t.className.replace(RegExp(m,"gi"),""),t.classList.add("language-"+r)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(s){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack)||[])[1];if(t){var r=document.getElementsByTagName("script");for(var i in r)if(r[i].src==t)return r[i]}return null}},isActive:function(t,r,i){for(var s="no-"+r;t;){var o=t.classList;if(o.contains(r))return!0;if(o.contains(s))return!1;t=t.parentElement}return!!i}},languages:{plain:w,plaintext:w,text:w,txt:w,extend:function(t,r){var i=l.util.clone(l.languages[t]);for(var s in r)i[s]=r[s];return i},insertBefore:function(t,r,i,s){s=s||l.languages;var o=s[t],p={};for(var E in o)if(o.hasOwnProperty(E)){if(E==r)for(var g in i)i.hasOwnProperty(g)&&(p[g]=i[g]);i.hasOwnProperty(E)||(p[E]=o[E])}var L=s[t];return s[t]=p,l.languages.DFS(l.languages,function(D,W){W===L&&D!=t&&(this[D]=p)}),p},DFS:function t(r,i,s,o){o=o||{};var p=l.util.objId;for(var E in r)if(r.hasOwnProperty(E)){i.call(r,E,r[E],s||E);var g=r[E],L=l.util.type(g);L==="Object"&&!o[p(g)]?(o[p(g)]=!0,t(g,i,null,o)):L==="Array"&&!o[p(g)]&&(o[p(g)]=!0,t(g,i,E,o))}}},plugins:{},highlightAll:function(t,r){l.highlightAllUnder(document,t,r)},highlightAllUnder:function(t,r,i){var s={callback:i,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",s),s.elements=Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)),l.hooks.run("before-all-elements-highlight",s);for(var o=0,p;p=s.elements[o++];)l.highlightElement(p,r===!0,s.callback)},highlightElement:function(t,r,i){var s=l.util.getLanguage(t),o=l.languages[s];l.util.setLanguage(t,s);var p=t.parentElement;p&&p.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(p,s);var E=t.textContent,g={element:t,language:s,grammar:o,code:E};function L(W){g.highlightedCode=W,l.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,l.hooks.run("after-highlight",g),l.hooks.run("complete",g),i&&i.call(g.element)}if(l.hooks.run("before-sanity-check",g),p=g.element.parentElement,p&&p.nodeName.toLowerCase()==="pre"&&!p.hasAttribute("tabindex")&&p.setAttribute("tabindex","0"),!g.code){l.hooks.run("complete",g),i&&i.call(g.element);return}if(l.hooks.run("before-highlight",g),!g.grammar){L(l.util.encode(g.code));return}if(r&&c.Worker){var D=new Worker(l.filename);D.onmessage=function(W){L(W.data)},D.postMessage(JSON.stringify({language:g.language,code:g.code,immediateClose:!0}))}else L(l.highlight(g.code,g.grammar,g.language))},highlight:function(t,r,i){var s={code:t,grammar:r,language:i};if(l.hooks.run("before-tokenize",s),!s.grammar)throw new Error('The language "'+s.language+'" has no grammar.');return s.tokens=l.tokenize(s.code,s.grammar),l.hooks.run("after-tokenize",s),b.stringify(l.util.encode(s.tokens),s.language)},tokenize:function(t,r){var i=r.rest;if(i){for(var s in i)r[s]=i[s];delete r.rest}var o=new I;return j(o,o.head,t),F(t,o,r,o.head,0),z(o)},hooks:{all:{},add:function(t,r){var i=l.hooks.all;i[t]=i[t]||[],i[t].push(r)},run:function(t,r){var i=l.hooks.all[t];if(!(!i||!i.length))for(var s=0,o;o=i[s++];)o(r)}},Token:b};c.Prism=l;function b(t,r,i,s){this.type=t,this.content=r,this.alias=i,this.length=(s||"").length|0}b.stringify=function t(r,i){if(typeof r=="string")return r;if(Array.isArray(r)){var s="";return r.forEach(function(L){s+=t(L,i)}),s}var o={type:r.type,content:t(r.content,i),tag:"span",classes:["token",r.type],attributes:{},language:i},p=r.alias;p&&(Array.isArray(p)?Array.prototype.push.apply(o.classes,p):o.classes.push(p)),l.hooks.run("wrap",o);var E="";for(var g in o.attributes)E+=" "+g+'="'+(o.attributes[g]||"").replace(/"/g,""")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+E+">"+o.content+"</"+o.tag+">"};function x(t,r,i,s){t.lastIndex=r;var o=t.exec(i);if(o&&s&&o[1]){var p=o[1].length;o.index+=p,o[0]=o[0].slice(p)}return o}function F(t,r,i,s,o,p){for(var E in i)if(!(!i.hasOwnProperty(E)||!i[E])){var g=i[E];g=Array.isArray(g)?g:[g];for(var L=0;L<g.length;++L){if(p&&p.cause==E+","+L)return;var D=g[L],W=D.inside,X=!!D.lookbehind,G=!!D.greedy,ne=D.alias;if(G&&!D.pattern.global){var ue=D.pattern.toString().match(/[imsuy]*$/)[0];D.pattern=RegExp(D.pattern.source,ue+"g")}for(var le=D.pattern||D,$=s.next,B=o;$!==r.tail&&!(p&&B>=p.reach);B+=$.value.length,$=$.next){var ee=$.value;if(r.length>t.length)return;if(!(ee instanceof b)){var K=1,Y;if(G){if(Y=x(le,B,t,X),!Y||Y.index>=t.length)break;var ae=Y.index,de=Y.index+Y[0].length,q=B;for(q+=$.value.length;ae>=q;)$=$.next,q+=$.value.length;if(q-=$.value.length,B=q,$.value instanceof b)continue;for(var oe=$;oe!==r.tail&&(q<de||typeof oe.value=="string");oe=oe.next)K++,q+=oe.value.length;K--,ee=t.slice(B,q),Y.index-=B}else if(Y=x(le,0,ee,X),!Y)continue;var ae=Y.index,J=Y[0],ie=ee.slice(0,ae),se=ee.slice(ae+J.length),te=B+ee.length;p&&te>p.reach&&(p.reach=te);var T=$.prev;ie&&(T=j(r,T,ie),B+=ie.length),N(r,T,K);var U=new b(E,W?l.tokenize(J,W):J,ne,J);if($=j(r,T,U),se&&j(r,$,se),K>1){var re={cause:E+","+L,reach:te};F(t,r,i,$.prev,B,re),p&&re.reach>p.reach&&(p.reach=re.reach)}}}}}}function I(){var t={value:null,prev:null,next:null},r={value:null,prev:t,next:null};t.next=r,this.head=t,this.tail=r,this.length=0}function j(t,r,i){var s=r.next,o={value:i,prev:r,next:s};return r.next=o,s.prev=o,t.length++,o}function N(t,r,i){for(var s=r.next,o=0;o<i&&s!==t.tail;o++)s=s.next;r.next=s,s.prev=r,t.length-=o}function z(t){for(var r=[],i=t.head.next;i!==t.tail;)r.push(i.value),i=i.next;return r}if(!c.document)return c.addEventListener&&(l.disableWorkerMessageHandler||c.addEventListener("message",function(t){var r=JSON.parse(t.data),i=r.language,s=r.code,o=r.immediateClose;c.postMessage(l.highlight(s,l.languages[i],i)),o&&c.close()},!1)),l;var O=l.util.currentScript();O&&(l.filename=O.src,O.hasAttribute("data-manual")&&(l.manual=!0));function A(){l.manual||l.highlightAll()}if(!l.manual){var R=document.readyState;R==="loading"||R==="interactive"&&O&&O.defer?document.addEventListener("DOMContentLoaded",A):window.requestAnimationFrame?window.requestAnimationFrame(A):window.setTimeout(A,16)}return l}(f);d.exports&&(d.exports=n),typeof We<"u"&&(We.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(c){c.type==="entity"&&(c.attributes.title=c.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(m,_){var w={};w["language-"+_]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[_]},w.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:w}};l["language-"+_]={pattern:/[\s\S]+/,inside:n.languages[_]};var b={};b[m]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return m}),"i"),lookbehind:!0,greedy:!0,inside:l},n.languages.insertBefore("markup","cdata",b)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(c,m){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+c+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[m,"language-"+m],inside:n.languages[m]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(c){var m=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;c.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+m.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+m.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+m.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+m.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:m,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},c.languages.css.atrule.inside.rest=c.languages.css;var _=c.languages.markup;_&&(_.tag.addInlined("style","css"),_.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var c="Loading…",m=function(O,A){return"✖ Error "+O+" while fetching file: "+A},_="✖ Error: File does not exist or is empty",w={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},l="data-src-status",b="loading",x="loaded",F="failed",I="pre[data-src]:not(["+l+'="'+x+'"]):not(['+l+'="'+b+'"])';function j(O,A,R){var t=new XMLHttpRequest;t.open("GET",O,!0),t.onreadystatechange=function(){t.readyState==4&&(t.status<400&&t.responseText?A(t.responseText):t.status>=400?R(m(t.status,t.statusText)):R(_))},t.send(null)}function N(O){var A=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(O||"");if(A){var R=Number(A[1]),t=A[2],r=A[3];return t?r?[R,Number(r)]:[R,void 0]:[R,R]}}n.hooks.add("before-highlightall",function(O){O.selector+=", "+I}),n.hooks.add("before-sanity-check",function(O){var A=O.element;if(A.matches(I)){O.code="",A.setAttribute(l,b);var R=A.appendChild(document.createElement("CODE"));R.textContent=c;var t=A.getAttribute("data-src"),r=O.language;if(r==="none"){var i=(/\.(\w+)$/.exec(t)||[,"none"])[1];r=w[i]||i}n.util.setLanguage(R,r),n.util.setLanguage(A,r);var s=n.plugins.autoloader;s&&s.loadLanguages(r),j(t,function(o){A.setAttribute(l,x);var p=N(A.getAttribute("data-range"));if(p){var E=o.split(/\r\n?|\n/g),g=p[0],L=p[1]==null?E.length:p[1];g<0&&(g+=E.length),g=Math.max(0,Math.min(g-1,E.length)),L<0&&(L+=E.length),L=Math.max(0,Math.min(L,E.length)),o=E.slice(g,L).join(`
|
|
38
|
-
`),A.hasAttribute("data-start")||A.setAttribute("data-start",String(g+1))}R.textContent=o,n.highlightElement(R)},function(o){A.setAttribute(l,F),R.textContent=o})}}),n.plugins.fileHighlight={highlight:function(A){for(var R=(A||document).querySelectorAll(I),t=0,r;r=R[t++];)n.highlightElement(r)}};var z=!1;n.fileHighlight=function(){z||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),z=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Xe);var xt=Xe.exports;const _e=vt(xt);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];(function(d){var f=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,c={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};d.languages.java=d.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[c,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:c.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:c.inside}],keyword:f,function:[d.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),d.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),d.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":c,keyword:f,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:c.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:c.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return f.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(d){for(var f=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)f=f.replace(/<self>/g,function(){return f});f=f.replace(/<self>/g,function(){return/[^\s\S]/.source}),d.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+f),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},d.languages.rust["closure-params"].inside.rest=d.languages.rust,d.languages.rust.attribute.inside.string=d.languages.rust.string})(Prism);Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(d){var f="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},c={bash:n,environment:{pattern:RegExp("\\$"+f),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+f),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};d.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+f),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:c},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:c},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:c.entity}}],environment:{pattern:RegExp("\\$?"+f),alias:"constant"},variable:c.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=d.languages.bash;for(var m=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],_=c.variable[1].inside,w=0;w<m.length;w++)_[m[w]]=d.languages.bash[m[w]];d.languages.sh=d.languages.bash,d.languages.shell=d.languages.bash})(Prism);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;function St(d){if(typeof document>"u")return;const f=d==="dark"?"prism-okaidia":"prism",n=document.getElementById("prism-theme-style"),c=`https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/${f}.min.css`;if(n)n.setAttribute("href",c);else{const m=document.createElement("link");m.id="prism-theme-style",m.rel="stylesheet",m.href=c,document.head.appendChild(m)}}window.Prism=_e;const wt={javascript:"javascript",js:"javascript",typescript:"typescript",ts:"typescript",python:"python",py:"python",java:"java",c:"c",cpp:"cpp","c++":"cpp",csharp:"csharp","c#":"csharp",go:"go",golang:"go",rust:"rust",ruby:"ruby",rb:"ruby",php:"php",swift:"swift",kotlin:"kotlin",kt:"kotlin",sql:"sql",bash:"bash",sh:"bash",shell:"bash",json:"json",yaml:"yaml",yml:"yaml",markdown:"markdown",md:"markdown"};function At(d){const f=document.createElement("div");return f.textContent=d,f.innerHTML}const Tt=({value:d,language:f,theme:n="dark",disabled:c=!1,onChange:m})=>{const _=y.useRef(null),w=y.useRef(null),l=y.useMemo(()=>wt[f.toLowerCase()]||"javascript",[f]),b=n==="dark"?"#1e1e1e":"#fafafa",x=y.useMemo(()=>{try{const N=_e.languages[l];if(N)return _e.highlight(d||"",N,l)}catch{}return At(d||"")},[d,l]),F=N=>{m==null||m(N.target.value)},I=()=>{_.current&&w.current&&(w.current.scrollTop=_.current.scrollTop,w.current.scrollLeft=_.current.scrollLeft)};y.useEffect(()=>{St(n)},[n]);const j=N=>{if(N.key==="Tab"){N.preventDefault();const z=N.target,O=z.selectionStart,A=z.selectionEnd,R=d.substring(0,O)+" "+d.substring(A);m==null||m(R),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=O+2})}};return h.jsxs("div",{className:`code-editor theme-${n}`,style:{background:b},children:[h.jsx("pre",{ref:w,className:`code-highlight language-${l}`,"aria-hidden":"true",children:h.jsx("code",{dangerouslySetInnerHTML:{__html:x}})}),h.jsx("textarea",{ref:_,className:"code-input",value:d,disabled:c,onChange:F,onScroll:I,onKeyDown:j,spellCheck:!1,placeholder:"Write your code here..."})]})};var kt=Object.defineProperty,Rt=(d,f,n)=>f in d?kt(d,f,{enumerable:!0,configurable:!0,writable:!0,value:n}):d[f]=n,Ve=(d,f,n)=>Rt(d,typeof f!="symbol"?f+"":f,n);let Te=null;class _t{constructor(f={}){Ve(this,"baseUrl"),Ve(this,"timeout"),this.baseUrl=f.pistonUrl||"/api/piston",this.timeout=f.timeout||3e3}async getRuntimes(f=!1){if(Te&&!f)return Te;try{const n=await fetch(`${this.baseUrl}/runtimes`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`Failed to fetch runtimes: ${n.statusText}`);const c=await n.json();return Te=c,c}catch(n){throw console.error("Failed to fetch runtimes:",n),n}}async execute(f,n,c={}){const m=(await this.getRuntimes()).find(b=>{var x;return b.language.toLowerCase()===f.toLowerCase()||((x=b.aliases)==null?void 0:x.some(F=>F.toLowerCase()===f.toLowerCase()))});if(!m)throw new Error(`Language '${f}' is not supported`);const _=this.getFileName(f),w={language:m.language,version:c.version||m.version,files:[{name:_,content:n}],stdin:c.stdin||"",args:c.args||[],run_timeout:c.runTimeout||this.timeout,compile_timeout:this.timeout},l=Date.now();try{const b=await fetch(`${this.baseUrl}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!b.ok)throw new Error(`Execute failed: ${b.statusText}`);const x=await b.json(),F=Date.now()-l,I=x.run.stdout||"",j=x.run.stderr||"";return{success:x.run.code===0,output:I,stderr:j,code:x.run.code,executionTime:F,compile:x.compile?{stdout:x.compile.stdout||"",stderr:x.compile.stderr||"",code:x.compile.code}:void 0}}catch(b){return{success:!1,output:"",stderr:b instanceof Error?b.message:"Unknown error",code:-1,executionTime:Date.now()-l}}}getFileName(f){return{javascript:"main.js",typescript:"main.ts",python:"main.py",python3:"main.py",go:"main.go",rust:"main.rs",java:"Main.java",c:"main.c",cpp:"main.cpp",csharp:"Main.cs",ruby:"main.rb",php:"main.php",bash:"main.sh",shell:"main.sh",perl:"main.pl",lua:"main.lua",swift:"main.swift",kotlin:"Main.kt",scala:"Main.scala",haskell:"main.hs",dart:"main.dart",html:"index.html",css:"style.css",sql:"query.sql",markdown:"readme.md"}[f.toLowerCase()]||`main.${f}`}}const Ft={javascript:'console.log("Hello, World!");',typescript:'console.log("Hello, World!");',python:'print("Hello, World!")',python3:'print("Hello, World!")',go:`package main
|
|
38
|
+
`),A.hasAttribute("data-start")||A.setAttribute("data-start",String(g+1))}R.textContent=o,n.highlightElement(R)},function(o){A.setAttribute(l,F),R.textContent=o})}}),n.plugins.fileHighlight={highlight:function(A){for(var R=(A||document).querySelectorAll(I),t=0,r;r=R[t++];)n.highlightElement(r)}};var z=!1;n.fileHighlight=function(){z||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),z=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Xe);var xt=Xe.exports;const _e=vt(xt);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];(function(d){var f=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,c={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};d.languages.java=d.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[c,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:c.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:c.inside}],keyword:f,function:[d.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),d.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),d.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":c,keyword:f,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:c.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:c.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return f.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(d){for(var f=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)f=f.replace(/<self>/g,function(){return f});f=f.replace(/<self>/g,function(){return/[^\s\S]/.source}),d.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+f),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},d.languages.rust["closure-params"].inside.rest=d.languages.rust,d.languages.rust.attribute.inside.string=d.languages.rust.string})(Prism);Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(d){var f="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},c={bash:n,environment:{pattern:RegExp("\\$"+f),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+f),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};d.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+f),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:c},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:c},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:c.entity}}],environment:{pattern:RegExp("\\$?"+f),alias:"constant"},variable:c.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=d.languages.bash;for(var m=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],_=c.variable[1].inside,w=0;w<m.length;w++)_[m[w]]=d.languages.bash[m[w]];d.languages.sh=d.languages.bash,d.languages.shell=d.languages.bash})(Prism);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;function St(d){if(typeof document>"u")return;const f=d==="dark"?"prism-okaidia":"prism",n=document.getElementById("prism-theme-style"),c=`https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/${f}.min.css`;if(n)n.setAttribute("href",c);else{const m=document.createElement("link");m.id="prism-theme-style",m.rel="stylesheet",m.href=c,document.head.appendChild(m)}}window.Prism=_e;const wt={javascript:"javascript",js:"javascript",typescript:"typescript",ts:"typescript",python:"python",py:"python",java:"java",c:"c",cpp:"cpp","c++":"cpp",csharp:"csharp","c#":"csharp",go:"go",golang:"go",rust:"rust",ruby:"ruby",rb:"ruby",php:"php",swift:"swift",kotlin:"kotlin",kt:"kotlin",sql:"sql",bash:"bash",sh:"bash",shell:"bash",json:"json",yaml:"yaml",yml:"yaml",markdown:"markdown",md:"markdown"};function At(d){const f=document.createElement("div");return f.textContent=d,f.innerHTML}const Tt=({value:d,language:f,theme:n="dark",disabled:c=!1,onChange:m})=>{const _=y.useRef(null),w=y.useRef(null),l=y.useMemo(()=>wt[f.toLowerCase()]||"javascript",[f]),b=n==="dark"?"#1e1e1e":"#fafafa",x=y.useMemo(()=>{try{const N=_e.languages[l];if(N)return _e.highlight(d||"",N,l)}catch{}return At(d||"")},[d,l]),F=N=>{m==null||m(N.target.value)},I=()=>{_.current&&w.current&&(w.current.scrollTop=_.current.scrollTop,w.current.scrollLeft=_.current.scrollLeft)};y.useEffect(()=>{St(n)},[n]);const j=N=>{if(N.key==="Tab"){N.preventDefault();const z=N.target,O=z.selectionStart,A=z.selectionEnd,R=d.substring(0,O)+" "+d.substring(A);m==null||m(R),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=O+2})}};return h.jsxs("div",{className:`hep-cr-editor theme-${n}`,style:{background:b},children:[h.jsx("pre",{ref:w,className:`hep-cr-highlight language-${l}`,"aria-hidden":"true",children:h.jsx("code",{dangerouslySetInnerHTML:{__html:x}})}),h.jsx("textarea",{ref:_,className:"hep-cr-input",value:d,disabled:c,onChange:F,onScroll:I,onKeyDown:j,spellCheck:!1,placeholder:"Write your code here..."})]})};var kt=Object.defineProperty,Rt=(d,f,n)=>f in d?kt(d,f,{enumerable:!0,configurable:!0,writable:!0,value:n}):d[f]=n,Ve=(d,f,n)=>Rt(d,typeof f!="symbol"?f+"":f,n);let Te=null;class _t{constructor(f={}){Ve(this,"baseUrl"),Ve(this,"timeout"),this.baseUrl=f.pistonUrl||"/api/piston",this.timeout=f.timeout||3e3}async getRuntimes(f=!1){if(Te&&!f)return Te;try{const n=await fetch(`${this.baseUrl}/runtimes`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`Failed to fetch runtimes: ${n.statusText}`);const c=await n.json();return Te=c,c}catch(n){throw console.error("Failed to fetch runtimes:",n),n}}async execute(f,n,c={}){const m=(await this.getRuntimes()).find(b=>{var x;return b.language.toLowerCase()===f.toLowerCase()||((x=b.aliases)==null?void 0:x.some(F=>F.toLowerCase()===f.toLowerCase()))});if(!m)throw new Error(`Language '${f}' is not supported`);const _=this.getFileName(f),w={language:m.language,version:c.version||m.version,files:[{name:_,content:n}],stdin:c.stdin||"",args:c.args||[],run_timeout:c.runTimeout||this.timeout,compile_timeout:this.timeout},l=Date.now();try{const b=await fetch(`${this.baseUrl}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!b.ok)throw new Error(`Execute failed: ${b.statusText}`);const x=await b.json(),F=Date.now()-l,I=x.run.stdout||"",j=x.run.stderr||"";return{success:x.run.code===0,output:I,stderr:j,code:x.run.code,executionTime:F,compile:x.compile?{stdout:x.compile.stdout||"",stderr:x.compile.stderr||"",code:x.compile.code}:void 0}}catch(b){return{success:!1,output:"",stderr:b instanceof Error?b.message:"Unknown error",code:-1,executionTime:Date.now()-l}}}getFileName(f){return{javascript:"main.js",typescript:"main.ts",python:"main.py",python3:"main.py",go:"main.go",rust:"main.rs",java:"Main.java",c:"main.c",cpp:"main.cpp",csharp:"Main.cs",ruby:"main.rb",php:"main.php",bash:"main.sh",shell:"main.sh",perl:"main.pl",lua:"main.lua",swift:"main.swift",kotlin:"Main.kt",scala:"Main.scala",haskell:"main.hs",dart:"main.dart",html:"index.html",css:"style.css",sql:"query.sql",markdown:"readme.md"}[f.toLowerCase()]||`main.${f}`}}const Ft={javascript:'console.log("Hello, World!");',typescript:'console.log("Hello, World!");',python:'print("Hello, World!")',python3:'print("Hello, World!")',go:`package main
|
|
39
39
|
|
|
40
40
|
import "fmt"
|
|
41
41
|
|
|
@@ -101,8 +101,8 @@ h1 {
|
|
|
101
101
|
}`,sql:"SELECT 'Hello, World!' AS message;",markdown:`# Hello, World!
|
|
102
102
|
|
|
103
103
|
This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();return Ft[f]||`// ${d}
|
|
104
|
-
// Write your code here`}const Fe=({pistonUrl:d="/api/piston",language:f="javascript",theme:n="light",showLanguageSelector:c=!0,showEditor:m=!0,editable:_=!0,defaultCode:w="",executorLabel:l="运行",onExecuteStart:b,onExecuteEnd:x,onLanguageChange:F})=>{const[I,j]=y.useState([]),[N,z]=y.useState(f),[O,A]=y.useState(n),[R,t]=y.useState(w),[r,i]=y.useState(""),[s,o]=y.useState(""),[p,E]=y.useState(!1),[g,L]=y.useState(null),[D,W]=y.useState("stdout"),[X,G]=y.useState(null),[ne,ue]=y.useState(!0),[le,$]=y.useState(60),B=y.useMemo(()=>new _t({pistonUrl:d}),[d]),ee=y.useMemo(()=>I.map(T=>({value:`${T.language}:${T.version}`,label:`${T.language.charAt(0).toUpperCase()+T.language.slice(1)} ${T.version}`})),[I]),K=y.useMemo(()=>N.includes(":")?N.split(":")[0]:N,[N]);y.useEffect(()=>{async function T(){ue(!0),G(null);try{const U=await B.getRuntimes();j(U)}catch(U){G(U instanceof Error?U.message:"Failed to load runtimes")}finally{ue(!1)}}T()},[B]),y.useEffect(()=>{!R&&I.length>0&&t(w||ke(K))},[I,R,w,K]);const Y=y.useCallback(T=>{const U=T.target.value,re=U.includes(":")?U.split(":")[0]:U;z(U);const pe=ke(re);t(pe),F==null||F(re,pe)},[F]),de=y.useCallback(async()=>{if(!p){E(!0),i(""),o(""),L(null),G(null),W("stdout"),b==null||b();try{const T=await B.execute(K,R);i(T.output),o(T.stderr),L(T.executionTime||null),W(T.stderr?"stderr":"stdout"),x==null||x(T)}catch(T){const U=T instanceof Error?T.message:"Execution failed";G(U),x==null||x({success:!1,output:"",stderr:U,code:-1})}finally{E(!1)}}},[p,N,R,B,b,x]),q=y.useCallback(()=>{i(""),o(""),L(null),G(null)},[]),oe=y.useCallback(async()=>{const T=D==="stdout"?r:s;await navigator.clipboard.writeText(T)},[D,r,s]),ae=y.useCallback(()=>{t(ke(K))},[N]),J=y.useRef(!1),ie=y.useCallback(T=>{J.current=!0,document.addEventListener("mousemove",se),document.addEventListener("mouseup",te),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),se=y.useCallback(T=>{if(!J.current)return;const U=document.querySelector(".
|
|
105
|
-
.
|
|
104
|
+
// Write your code here`}const Fe=({pistonUrl:d="/api/piston",language:f="javascript",theme:n="light",showLanguageSelector:c=!0,showEditor:m=!0,editable:_=!0,defaultCode:w="",executorLabel:l="运行",onExecuteStart:b,onExecuteEnd:x,onLanguageChange:F})=>{const[I,j]=y.useState([]),[N,z]=y.useState(f),[O,A]=y.useState(n),[R,t]=y.useState(w),[r,i]=y.useState(""),[s,o]=y.useState(""),[p,E]=y.useState(!1),[g,L]=y.useState(null),[D,W]=y.useState("stdout"),[X,G]=y.useState(null),[ne,ue]=y.useState(!0),[le,$]=y.useState(60),B=y.useMemo(()=>new _t({pistonUrl:d}),[d]),ee=y.useMemo(()=>I.map(T=>({value:`${T.language}:${T.version}`,label:`${T.language.charAt(0).toUpperCase()+T.language.slice(1)} ${T.version}`})),[I]),K=y.useMemo(()=>N.includes(":")?N.split(":")[0]:N,[N]);y.useEffect(()=>{async function T(){ue(!0),G(null);try{const U=await B.getRuntimes();j(U)}catch(U){G(U instanceof Error?U.message:"Failed to load runtimes")}finally{ue(!1)}}T()},[B]),y.useEffect(()=>{!R&&I.length>0&&t(w||ke(K))},[I,R,w,K]);const Y=y.useCallback(T=>{const U=T.target.value,re=U.includes(":")?U.split(":")[0]:U;z(U);const pe=ke(re);t(pe),F==null||F(re,pe)},[F]),de=y.useCallback(async()=>{if(!p){E(!0),i(""),o(""),L(null),G(null),W("stdout"),b==null||b();try{const T=await B.execute(K,R);i(T.output),o(T.stderr),L(T.executionTime||null),W(T.stderr?"stderr":"stdout"),x==null||x(T)}catch(T){const U=T instanceof Error?T.message:"Execution failed";G(U),x==null||x({success:!1,output:"",stderr:U,code:-1})}finally{E(!1)}}},[p,N,R,B,b,x]),q=y.useCallback(()=>{i(""),o(""),L(null),G(null)},[]),oe=y.useCallback(async()=>{const T=D==="stdout"?r:s;await navigator.clipboard.writeText(T)},[D,r,s]),ae=y.useCallback(()=>{t(ke(K))},[N]),J=y.useRef(!1),ie=y.useCallback(T=>{J.current=!0,document.addEventListener("mousemove",se),document.addEventListener("mouseup",te),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),se=y.useCallback(T=>{if(!J.current)return;const U=document.querySelector(".hep-cr-main");if(!U)return;const re=U.getBoundingClientRect(),pe=(T.clientX-re.left)/re.width*100;$(Math.max(20,Math.min(80,pe)))},[]),te=y.useCallback(()=>{J.current=!1,document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",te),document.body.style.cursor="",document.body.style.userSelect=""},[se]);return h.jsxs("div",{className:`hep-cr-runner hep-cr-runner-${O}`,children:[h.jsxs("div",{className:"hep-cr-header",children:[h.jsx("div",{className:"hep-cr-controls",children:c&&h.jsxs("select",{value:N,onChange:Y,className:"hep-cr-language-select",disabled:p,children:[ne&&h.jsx("option",{value:"",children:"加载中..."}),ee.map(T=>h.jsx("option",{value:T.value,children:T.label},T.value))]})}),h.jsxs("div",{className:"hep-cr-actions",children:[h.jsxs("button",{className:"hep-cr-btn hep-cr-btn-run",disabled:p||ne,onClick:de,children:[p?h.jsx("span",{className:"hep-cr-spinner"}):h.jsx("span",{className:"hep-cr-run-icon",children:"▶"}),p?"运行中...":l]}),m&&_&&h.jsx("button",{className:"hep-cr-btn hep-cr-btn-reset",onClick:ae,children:"重置"}),h.jsx("button",{className:"hep-cr-btn hep-cr-btn-theme",onClick:()=>A(O==="light"?"dark":"light"),title:O==="light"?"Switch to dark mode":"Switch to light mode",children:O==="light"?"🌙":"☀️"})]})]}),X&&h.jsx("div",{className:"hep-cr-error-message",children:X}),h.jsxs("div",{className:"hep-cr-main",children:[m&&h.jsxs("div",{className:"hep-cr-editor-panel",style:{width:`${le}%`},children:[h.jsxs("div",{className:"hep-cr-panel-header",children:[h.jsx("span",{className:"hep-cr-panel-title",children:"编辑器"}),h.jsx("span",{className:"hep-cr-language-badge",children:K})]}),h.jsx(Tt,{value:R,language:K,theme:O,disabled:!_||p,onChange:t})]}),m&&h.jsx("div",{className:"hep-cr-resize-handle",onMouseDown:ie,children:h.jsx("div",{className:"hep-cr-resize-line"})}),h.jsxs("div",{className:"hep-cr-output-panel",style:{width:m?`${100-le}%`:"100%"},children:[h.jsxs("div",{className:"hep-cr-panel-header",children:[h.jsxs("div",{className:"hep-cr-output-tabs",children:[h.jsx("button",{className:`hep-cr-tab ${D==="stdout"?"active":""}`,onClick:()=>W("stdout"),children:"输出"}),s&&h.jsx("button",{className:`hep-cr-tab ${D==="stderr"?"active":""}`,onClick:()=>W("stderr"),children:"错误"})]}),h.jsxs("div",{className:"hep-cr-output-actions",children:[g!==null&&h.jsxs("span",{className:"hep-cr-execution-time",children:[g,"ms"]}),h.jsx("button",{className:"hep-cr-btn-icon",onClick:oe,title:"复制",children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),h.jsx("button",{className:"hep-cr-btn-icon",onClick:q,title:"清除",children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("polyline",{points:"3 6 5 6 21 6"}),h.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),h.jsx("div",{className:"hep-cr-output-content",children:h.jsx("pre",{children:D==="stdout"?r||'点击"运行"执行代码':s})})]})]}),h.jsx("style",{children:`
|
|
105
|
+
.hep-cr-runner {
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-direction: column;
|
|
108
108
|
border: 1px solid #e0e0e0;
|
|
@@ -110,9 +110,9 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
110
110
|
overflow: hidden;
|
|
111
111
|
font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
112
112
|
}
|
|
113
|
-
.
|
|
114
|
-
.
|
|
115
|
-
.
|
|
113
|
+
.hep-cr-runner-dark { background: #1e1e1e; border-color: #333; }
|
|
114
|
+
.hep-cr-runner-light { background: #ffffff; }
|
|
115
|
+
.hep-cr-header {
|
|
116
116
|
display: flex;
|
|
117
117
|
justify-content: space-between;
|
|
118
118
|
align-items: center;
|
|
@@ -120,9 +120,9 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
120
120
|
background: #252526;
|
|
121
121
|
border-bottom: 1px solid #333;
|
|
122
122
|
}
|
|
123
|
-
.
|
|
124
|
-
.
|
|
125
|
-
.language-select {
|
|
123
|
+
.hep-cr-runner-light .hep-cr-header { background: #f3f3f3; border-color: #e0e0e0; }
|
|
124
|
+
.hep-cr-controls { display: flex; gap: 8px; }
|
|
125
|
+
.hep-cr-language-select {
|
|
126
126
|
padding: 6px 12px;
|
|
127
127
|
border: 1px solid #444;
|
|
128
128
|
border-radius: 6px;
|
|
@@ -132,10 +132,10 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
132
132
|
cursor: pointer;
|
|
133
133
|
outline: none;
|
|
134
134
|
}
|
|
135
|
-
.
|
|
136
|
-
.language-select:focus { border-color: #4fc3f7; }
|
|
137
|
-
.
|
|
138
|
-
.btn {
|
|
135
|
+
.hep-cr-runner-light .hep-cr-language-select { background: white; color: #333; border-color: #ccc; }
|
|
136
|
+
.hep-cr-language-select:focus { border-color: #4fc3f7; }
|
|
137
|
+
.hep-cr-actions { display: flex; gap: 8px; }
|
|
138
|
+
.hep-cr-btn {
|
|
139
139
|
padding: 6px 16px;
|
|
140
140
|
border: none;
|
|
141
141
|
border-radius: 6px;
|
|
@@ -147,31 +147,31 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
147
147
|
gap: 6px;
|
|
148
148
|
transition: all 0.2s;
|
|
149
149
|
}
|
|
150
|
-
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
151
|
-
.btn-run {
|
|
150
|
+
.hep-cr-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
151
|
+
.hep-cr-btn-run {
|
|
152
152
|
background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
|
|
153
153
|
color: white;
|
|
154
154
|
}
|
|
155
|
-
.btn-run:hover:not(:disabled) { background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%); }
|
|
156
|
-
.btn-reset { background: #3d3d3d; color: #aaa; }
|
|
157
|
-
.
|
|
158
|
-
.btn-theme { background: #3d3d3d; color: #aaa; padding: 5px 10px; font-size: 14px; line-height: 1; height: auto; min-height: 28px; }
|
|
159
|
-
.
|
|
160
|
-
.btn-theme:hover { background: #4d4d4d; color: #fff; }
|
|
161
|
-
.error-message {
|
|
155
|
+
.hep-cr-btn-run:hover:not(:disabled) { background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%); }
|
|
156
|
+
.hep-cr-btn-reset { background: #3d3d3d; color: #aaa; }
|
|
157
|
+
.hep-cr-runner-light .hep-cr-btn-reset { background: #e0e0e0; color: #666; }
|
|
158
|
+
.hep-cr-btn-theme { background: #3d3d3d; color: #aaa; padding: 5px 10px; font-size: 14px; line-height: 1; height: auto; min-height: 28px; }
|
|
159
|
+
.hep-cr-runner-light .hep-cr-btn-theme { background: #e0e0e0; }
|
|
160
|
+
.hep-cr-btn-theme:hover { background: #4d4d4d; color: #fff; }
|
|
161
|
+
.hep-cr-error-message {
|
|
162
162
|
padding: 10px 16px;
|
|
163
163
|
background: #c62828;
|
|
164
164
|
color: white;
|
|
165
165
|
font-size: 13px;
|
|
166
166
|
}
|
|
167
|
-
.
|
|
168
|
-
.editor-panel {
|
|
167
|
+
.hep-cr-main { display: flex; height: 400px; overflow: hidden; }
|
|
168
|
+
.hep-cr-editor-panel {
|
|
169
169
|
display: flex;
|
|
170
170
|
flex-direction: column;
|
|
171
171
|
min-width: 20%;
|
|
172
172
|
max-width: 80%;
|
|
173
173
|
}
|
|
174
|
-
.panel-header {
|
|
174
|
+
.hep-cr-panel-header {
|
|
175
175
|
display: flex;
|
|
176
176
|
justify-content: space-between;
|
|
177
177
|
align-items: center;
|
|
@@ -179,15 +179,15 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
179
179
|
background: #2d2d2d;
|
|
180
180
|
border-bottom: 1px solid #333;
|
|
181
181
|
}
|
|
182
|
-
.
|
|
183
|
-
.panel-title {
|
|
182
|
+
.hep-cr-runner-light .hep-cr-panel-header { background: #f0f0f0; border-color: #e0e0e0; }
|
|
183
|
+
.hep-cr-panel-title {
|
|
184
184
|
font-size: 12px;
|
|
185
185
|
font-weight: 600;
|
|
186
186
|
color: #888;
|
|
187
187
|
text-transform: uppercase;
|
|
188
188
|
letter-spacing: 0.5px;
|
|
189
189
|
}
|
|
190
|
-
.language-badge {
|
|
190
|
+
.hep-cr-language-badge {
|
|
191
191
|
font-size: 11px;
|
|
192
192
|
padding: 2px 8px;
|
|
193
193
|
background: #4fc3f7;
|
|
@@ -195,15 +195,15 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
195
195
|
border-radius: 10px;
|
|
196
196
|
font-weight: 500;
|
|
197
197
|
}
|
|
198
|
-
.
|
|
198
|
+
.hep-cr-editor {
|
|
199
199
|
flex: 1;
|
|
200
200
|
width: 100%;
|
|
201
201
|
background: #1e1e1e;
|
|
202
202
|
position: relative;
|
|
203
203
|
overflow: hidden;
|
|
204
204
|
}
|
|
205
|
-
.
|
|
206
|
-
.
|
|
205
|
+
.hep-cr-editor .hep-cr-highlight,
|
|
206
|
+
.hep-cr-editor .hep-cr-input {
|
|
207
207
|
position: absolute;
|
|
208
208
|
top: 0;
|
|
209
209
|
left: 0;
|
|
@@ -218,16 +218,16 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
218
218
|
white-space: pre;
|
|
219
219
|
overflow: auto;
|
|
220
220
|
}
|
|
221
|
-
.
|
|
221
|
+
.hep-cr-editor .hep-cr-highlight {
|
|
222
222
|
background: transparent !important;
|
|
223
223
|
pointer-events: none;
|
|
224
224
|
z-index: 1;
|
|
225
225
|
}
|
|
226
|
-
.
|
|
226
|
+
.hep-cr-editor .hep-cr-highlight code {
|
|
227
227
|
display: block;
|
|
228
228
|
font-family: inherit;
|
|
229
229
|
}
|
|
230
|
-
.
|
|
230
|
+
.hep-cr-editor .hep-cr-input {
|
|
231
231
|
background: transparent !important;
|
|
232
232
|
color: transparent !important;
|
|
233
233
|
caret-color: #d4d4d4;
|
|
@@ -235,14 +235,14 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
235
235
|
outline: none;
|
|
236
236
|
z-index: 2;
|
|
237
237
|
}
|
|
238
|
-
.
|
|
239
|
-
.
|
|
238
|
+
.hep-cr-editor .hep-cr-input:disabled { opacity: 0.7; }
|
|
239
|
+
.hep-cr-runner-light .hep-cr-editor .hep-cr-highlight code {
|
|
240
240
|
color: #333333;
|
|
241
241
|
}
|
|
242
|
-
.
|
|
242
|
+
.hep-cr-runner-light .hep-cr-editor .hep-cr-input {
|
|
243
243
|
caret-color: #333333;
|
|
244
244
|
}
|
|
245
|
-
.resize-handle {
|
|
245
|
+
.hep-cr-resize-handle {
|
|
246
246
|
width: 6px;
|
|
247
247
|
background: #252526;
|
|
248
248
|
cursor: col-resize;
|
|
@@ -250,18 +250,18 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
250
250
|
align-items: center;
|
|
251
251
|
justify-content: center;
|
|
252
252
|
}
|
|
253
|
-
.resize-handle:hover { background: #4fc3f7; }
|
|
254
|
-
.resize-line { width: 2px; height: 40px; background: #444; border-radius: 1px; }
|
|
255
|
-
.resize-handle:hover .resize-line { background: #fff; }
|
|
256
|
-
.output-panel {
|
|
253
|
+
.hep-cr-resize-handle:hover { background: #4fc3f7; }
|
|
254
|
+
.hep-cr-resize-line { width: 2px; height: 40px; background: #444; border-radius: 1px; }
|
|
255
|
+
.hep-cr-resize-handle:hover .hep-cr-resize-line { background: #fff; }
|
|
256
|
+
.hep-cr-output-panel {
|
|
257
257
|
display: flex;
|
|
258
258
|
flex-direction: column;
|
|
259
259
|
min-width: 20%;
|
|
260
260
|
border-left: 1px solid #333;
|
|
261
261
|
}
|
|
262
|
-
.
|
|
263
|
-
.output-tabs { display: flex; gap: 4px; }
|
|
264
|
-
.tab {
|
|
262
|
+
.hep-cr-runner-light .hep-cr-output-panel { border-color: #e0e0e0; }
|
|
263
|
+
.hep-cr-output-tabs { display: flex; gap: 4px; }
|
|
264
|
+
.hep-cr-tab {
|
|
265
265
|
padding: 4px 12px;
|
|
266
266
|
border: none;
|
|
267
267
|
background: transparent;
|
|
@@ -271,12 +271,12 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
271
271
|
color: #888;
|
|
272
272
|
transition: all 0.2s;
|
|
273
273
|
}
|
|
274
|
-
.tab:hover { color: #d4d4d4; background: #3d3d3d; }
|
|
275
|
-
.
|
|
276
|
-
.tab.active { background: #4fc3f7; color: #000; font-weight: 500; }
|
|
277
|
-
.output-actions { display: flex; align-items: center; gap: 12px; }
|
|
278
|
-
.execution-time { font-size: 12px; color: #4caf50; font-weight: 500; }
|
|
279
|
-
.btn-icon {
|
|
274
|
+
.hep-cr-tab:hover { color: #d4d4d4; background: #3d3d3d; }
|
|
275
|
+
.hep-cr-runner-light .hep-cr-tab:hover { color: #333; background: #e0e0e0; }
|
|
276
|
+
.hep-cr-tab.active { background: #4fc3f7; color: #000; font-weight: 500; }
|
|
277
|
+
.hep-cr-output-actions { display: flex; align-items: center; gap: 12px; }
|
|
278
|
+
.hep-cr-execution-time { font-size: 12px; color: #4caf50; font-weight: 500; }
|
|
279
|
+
.hep-cr-btn-icon {
|
|
280
280
|
background: transparent;
|
|
281
281
|
border: none;
|
|
282
282
|
cursor: pointer;
|
|
@@ -288,16 +288,16 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
288
288
|
justify-content: center;
|
|
289
289
|
transition: all 0.2s;
|
|
290
290
|
}
|
|
291
|
-
.btn-icon:hover { color: #fff; background: #3d3d3d; }
|
|
292
|
-
.
|
|
293
|
-
.output-content {
|
|
291
|
+
.hep-cr-btn-icon:hover { color: #fff; background: #3d3d3d; }
|
|
292
|
+
.hep-cr-runner-light .hep-cr-btn-icon:hover { color: #333; background: #e0e0e0; }
|
|
293
|
+
.hep-cr-output-content {
|
|
294
294
|
flex: 1;
|
|
295
295
|
padding: 12px 16px;
|
|
296
296
|
overflow: auto;
|
|
297
297
|
background: #1e1e1e;
|
|
298
298
|
}
|
|
299
|
-
.
|
|
300
|
-
.output-content pre {
|
|
299
|
+
.hep-cr-runner-light .hep-cr-output-content { background: #fff; }
|
|
300
|
+
.hep-cr-output-content pre {
|
|
301
301
|
margin: 0;
|
|
302
302
|
font-size: 13px;
|
|
303
303
|
line-height: 1.6;
|
|
@@ -305,9 +305,9 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
305
305
|
word-break: break-all;
|
|
306
306
|
color: #d4d4d4;
|
|
307
307
|
}
|
|
308
|
-
.
|
|
309
|
-
.output-content .stderr { color: #f44336; }
|
|
310
|
-
.spinner {
|
|
308
|
+
.hep-cr-runner-light .hep-cr-output-content pre { color: #333; }
|
|
309
|
+
.hep-cr-output-content .stderr { color: #f44336; }
|
|
310
|
+
.hep-cr-spinner {
|
|
311
311
|
width: 12px;
|
|
312
312
|
height: 12px;
|
|
313
313
|
border: 2px solid rgba(255,255,255,0.3);
|
|
@@ -316,8 +316,8 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
316
316
|
animation: spin 0.8s linear infinite;
|
|
317
317
|
}
|
|
318
318
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
319
|
-
`})]})},Ke=y.forwardRef(({open:d,defaultOpen:f=!1,title:n="代码执行器",width:c=800,onClose:m,footer:_,theme:w="light",...l},b)=>{const[x,F]=y.useState(f),I=d!==void 0,j=I?d:x;y.useEffect(()=>{I&&d!==x&&F(d)},[d,I]);const N=y.useCallback(()=>{I||F(!1),m==null||m()},[I,m]),z=A=>{A.target===A.currentTarget&&N()};y.useImperativeHandle(b,()=>({close:N}));const O=typeof c=="number"?`${c}px`:c;return j?h.jsxs("div",{className:"dialog-overlay",onClick:z,children:[h.jsxs("div",{className:"dialog-container",style:{width:O},children:[h.jsxs("div",{className:"dialog-header",children:[h.jsx("h3",{className:"dialog-title",children:n}),h.jsx("button",{className:"dialog-close",onClick:N,children:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),h.jsx("div",{className:"dialog-body",children:h.jsx(Fe,{theme:w,...l})}),_&&h.jsx("div",{className:"dialog-footer",children:_})]}),h.jsx("style",{children:`
|
|
320
|
-
.dialog-overlay {
|
|
319
|
+
`})]})},Ke=y.forwardRef(({open:d,defaultOpen:f=!1,title:n="代码执行器",width:c=800,onClose:m,footer:_,theme:w="light",...l},b)=>{const[x,F]=y.useState(f),I=d!==void 0,j=I?d:x;y.useEffect(()=>{I&&d!==x&&F(d)},[d,I]);const N=y.useCallback(()=>{I||F(!1),m==null||m()},[I,m]),z=A=>{A.target===A.currentTarget&&N()};y.useImperativeHandle(b,()=>({close:N}));const O=typeof c=="number"?`${c}px`:c;return j?h.jsxs("div",{className:"hep-cr-dialog-overlay",onClick:z,children:[h.jsxs("div",{className:"hep-cr-dialog-container",style:{width:O},children:[h.jsxs("div",{className:"hep-cr-dialog-header",children:[h.jsx("h3",{className:"hep-cr-dialog-title",children:n}),h.jsx("button",{className:"hep-cr-dialog-close",onClick:N,children:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),h.jsx("div",{className:"hep-cr-dialog-body",children:h.jsx(Fe,{theme:w,...l})}),_&&h.jsx("div",{className:"hep-cr-dialog-footer",children:_})]}),h.jsx("style",{children:`
|
|
320
|
+
.hep-cr-dialog-overlay {
|
|
321
321
|
position: fixed;
|
|
322
322
|
top: 0;
|
|
323
323
|
left: 0;
|
|
@@ -328,10 +328,10 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
328
328
|
align-items: center;
|
|
329
329
|
justify-content: center;
|
|
330
330
|
z-index: 9999;
|
|
331
|
-
animation: dialog-fade-in 0.2s ease;
|
|
331
|
+
animation: hep-cr-dialog-fade-in 0.2s ease;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
.dialog-container {
|
|
334
|
+
.hep-cr-dialog-container {
|
|
335
335
|
background: #fff;
|
|
336
336
|
border-radius: 12px;
|
|
337
337
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
@@ -340,10 +340,10 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
340
340
|
display: flex;
|
|
341
341
|
flex-direction: column;
|
|
342
342
|
overflow: hidden;
|
|
343
|
-
animation: dialog-scale-in 0.2s ease;
|
|
343
|
+
animation: hep-cr-dialog-scale-in 0.2s ease;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
.dialog-header {
|
|
346
|
+
.hep-cr-dialog-header {
|
|
347
347
|
display: flex;
|
|
348
348
|
align-items: center;
|
|
349
349
|
justify-content: space-between;
|
|
@@ -351,14 +351,14 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
351
351
|
border-bottom: 1px solid #e0e0e0;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
.dialog-title {
|
|
354
|
+
.hep-cr-dialog-title {
|
|
355
355
|
margin: 0;
|
|
356
356
|
font-size: 16px;
|
|
357
357
|
font-weight: 600;
|
|
358
358
|
color: #333;
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
.dialog-close {
|
|
361
|
+
.hep-cr-dialog-close {
|
|
362
362
|
background: none;
|
|
363
363
|
border: none;
|
|
364
364
|
cursor: pointer;
|
|
@@ -371,23 +371,23 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
371
371
|
transition: all 0.2s;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
.dialog-close:hover {
|
|
374
|
+
.hep-cr-dialog-close:hover {
|
|
375
375
|
background: #f0f0f0;
|
|
376
376
|
color: #333;
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
.dialog-body {
|
|
379
|
+
.hep-cr-dialog-body {
|
|
380
380
|
flex: 1;
|
|
381
381
|
overflow: auto;
|
|
382
382
|
padding: 0;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
.dialog-body .
|
|
385
|
+
.hep-cr-dialog-body .hep-cr-runner {
|
|
386
386
|
border: none;
|
|
387
387
|
border-radius: 0;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
.dialog-footer {
|
|
390
|
+
.hep-cr-dialog-footer {
|
|
391
391
|
padding: 12px 20px;
|
|
392
392
|
border-top: 1px solid #e0e0e0;
|
|
393
393
|
display: flex;
|
|
@@ -395,12 +395,12 @@ This is a sample markdown document.`};function ke(d){const f=d.toLowerCase();ret
|
|
|
395
395
|
gap: 12px;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
@keyframes dialog-fade-in {
|
|
398
|
+
@keyframes hep-cr-dialog-fade-in {
|
|
399
399
|
from { opacity: 0; }
|
|
400
400
|
to { opacity: 1; }
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
@keyframes dialog-scale-in {
|
|
403
|
+
@keyframes hep-cr-dialog-scale-in {
|
|
404
404
|
from { transform: scale(0.95); }
|
|
405
405
|
to { transform: scale(1); }
|
|
406
406
|
}
|